from flask import Flask, render_template
import threading
import nukerOberver2

app = Flask(__name__)


def nukerObserver():
    nukerOberver2.go()


@app.route('/')
def index():
    # 这里我们只是假设有一个名为'content.txt'的文件在你的项目的根目录下
    with open('../nukerList.txt', 'r', encoding='utf-8') as file:
        content = file.read()
    return render_template('index.html', content=content)


if __name__ == '__main__':
    # 使用 threading 模块启动一个新线程
    t = threading.Thread(target=nukerObserver)
    t.start()
    app.run(host='0.0.0.0', port=912)
